/*************************************************************************
> File Name: digital.cpp
> Author: icebear
> Mail: 3322366195@qq.com
> Created Time: 2023-08-09 09:27:44
> Description: 暴力解决 硬编码数字 判断个位十位依次拼接
************************************************************************/

#include <iostream>

using namespace std;
const string thousands[] = {"", "M", "MM", "MMM"};
const string hundreds[] = {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};
const string tens[] = {"", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"};
const string ones[] = {"", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"};

class Solution
{
public:
    string intToRoman(int num)
    {
        return thousands[num / 1000] + hundreds[num % 1000 / 100] + tens[num % 100 / 10] + ones[num % 10];
    }
};
int main(int argc, char const *argv[])
{
    Solution s;
    cout << s.intToRoman(1994) << endl;
    return 0;
}
